/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-06-01 10:00:03
 * @LastEditTime : 2023-06-27 11:09:35
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Router\MenuNav\ThrRouter\Organization.jsx
 * @Description  :
 */
import { API_LIST } from '../../../Api/Api'
import { commonTableList } from '../Common/common'
import { ProjectList } from '../Common/Conversion'

export const Organization = async ({ twoData }) => {
    const projectUuid = await ProjectList()
    let dataList = {
        uuid: twoData.uuid,
        isCheckbox: true,
        width: 1000,
        pageSize: 10,
        params: { pageIndex: 1, parentOrganizationUuid: twoData.uuid },
        get: API_LIST()['getOrganizationRelationGetNotOrgListByParentOrgUuid'],
        pos: 'posOrganizationRelation',
        assemblyData: e => {
            return e.map(key => ({
                parentOrganizationUuid: twoData.uuid,
                organizationUuid: key.uuid,
            }))
        },

        columns: [
            { ...commonTableList.projectUuid, valueEnum: projectUuid },
            { ...commonTableList.tableName, title: '组织机构' },
        ],
    }

    return dataList
}
